<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base_user.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>意见反馈</title>
    <style>
        .cur{
            border: 1px solid red !important;

        }
    </style>
</head>
<body>
<form action="" id="form" method="post">
<div class="wrap-sug">

    <div class="header">
        <p>意见反馈</p>
        <img src="__STATIC__/img_user/back.png" class="back" onclick=window.location.href="{:url('mobile/user_info/my_shop_index')}">
        <span><a id="save">提交</a></span>
    </div>
    <div class="type">
        <h4>反馈类型</h4>
        <ul>
            {volist name='type' id='v'}
            <li id="st_{$v.id}"><a href="javascript:selected({$v.id});" >{$v.title}</a></li>
            {/volist}
            <input type="hidden" name="type" datatype="*" errormsg="请选择反馈类型" nullmsg="请选择反馈类型" value=""/>
        </ul>
    </div>
    <div class="center">
        <span>反馈内容：</span>
        <textarea name="content" datatype="s100" nullmsg="请填写反馈内容" errormsg="内容过长" placeholder="200以内任意字符" ></textarea>
    </div>
    <div class="phone">
        <span>联系方式：</span><input type="text" name="contact" datatype="m|e" nullmsg="请填写联系方式" errormsg="联系方式格式不正确" placeholder="手机号或邮箱选填">
    </div>

</div>
</form>
{include file="public/src" /}
<script>
    function selected(id){
        $('#st_'+id).addClass('cur').siblings('li').removeClass('cur');
        $("[name='type']").val($('#st_'+id).text());
    }
    $(function () {
        $.Tipmsg.r = null;
        $.Tipmsg.p = null;
        $.Datatype.s100 = /^\S{1,200}$/;
        var demo = $("#form").Validform({
            btnSubmit:'#save',
            tiptype: function (msg) {
                layer.open({content: msg, skin: 'msg', time:4});
            },
            tipSweep: true,
            ajaxPost:true,
            callback:function(t){
                if (t.code == 200){
                    layer.open({content:t.message,skin:'msg',time:4});
                    setTimeout(function(){
                        window.location.reload();
                    },500);
                }else{
                    layer.open({content:t.message,skin:'msg',time:2});
                }
            }
        });
        demo.config({
            ajaxpost:{
                error: function () {
                    layer.open({content:'网络繁忙,请重试',skin:'msg',time:2});
                }
            }
        })
    });
</script>
</body>
</html>